Next | Prev | Up | Top | Contents | Index
Why Use the Texture Clamp Extensions?
When a texture coordinate is clamped using the default OpenGL 1.0 algorithm, and a GL_LINEAR filter or one of the LINEAR mipmap filters is used, the texture sampling filter straddles the edge of the texture image, taking half its sample values from within the texture image and the other half from the texture border.
It is sometimes desirable to alter the default behavior of OpenGL texture clamping operations as follows:
- Clamp a texture without requiring a border or a constant border color. This is possible with the texture clamping algorithm provided by the texture edge-clamp extension. GL_CLAMP_TO_EDGE_SGIS clamps texture coordinates at all mipmap levels such that the texture filter never samples a border texel.
When used with a GL_NEAREST or a GL_LINEAR filter, the color returned when clamping is derived only from texels at the edge of the texture image.
- Clamp a texture to the border color, rather than to an average of the border and edge colors. This is possible with the texture border-clamp extension. GL_CLAMP_TO_BORDER_SGIS clamps texture coordinates at all mipmap levels:
GL_NEAREST and GL_LINEAR filters return the color of the border texels.
This mode is well-suited for using projective textures such as spotlights.
Both clamping extensions are supported for one-, two-, and three-dimensional textures.
Next | Prev | Up | Top | Contents | Index